package org.compression.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.model.Member;
import org.model.auth.User;
import org.model.auth.UserGroup;
@Mapper
public interface UserGroupMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(UserGroup record);

    int insertSelective(UserGroup record);

    UserGroup selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(UserGroup record);

    int updateByPrimaryKey(UserGroup record);
    
    @Select("select m.mobile_no mobileNo,m.login_name loginName,m.wx_name wxName,m.id from sm_user m, sm_usergroup gu where gu.member_id=m.id and gu.group_id=#{id}")
    public List<User> getMembersGroup(String id);
    
    
    @Delete("delete from  sm_usergroup  where member_id=#{member_id} and group_id=#{group_id}")
    public void deleteUserRelate(@Param("member_id")String string,@Param("group_id")Integer b);

    @Select("select id from sm_usergroup where member_id=#{member_id} and group_id=#{group_id}")
    public Object  getselectById(@Param("member_id")String member_id,@Param("group_id")Integer integer);
    
    
    
}